function SetHome(obj, vrl) {
    try {
        obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl);
        alert("您的浏览器不支持，请按照下面步骤操作：1.打开浏览器设置。2.点击设置网页。3.输入：" + vrl + "点击确定。");

    }
    catch (e) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage', vrl);
        } else {
            alert("您的浏览器不支持，请按照下面步骤操作：1.打开浏览器设置。2.点击设置网页。3.输入：" + vrl + "点击确定。");
        }
    }
}
// 加入收藏 兼容360和IE6 
function shoucang(sTitle, sURL) {
    try {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e) {
        try {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e) {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}


function getUrlVars() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

jQuery(function () {

    // $("ul.second").hide();
    //$("ul.first li").hover(function () {
    //    $(this).find("ul.second").show(300)
    //}, function () {
    //    $(this).find("ul.second").hide(100)
    //})

    var FID = getUrlVars()["SortID"];
    if (FID != null) {
        $("#f" + FID).show();
        var list = jQuery(".cu" + FID);
        //list.removeClass('cu');
        $(list).addClass('cu');

        var FID2 = getUrlVars()["SortID2"];
        if (FID2 != null) {
            $("#f" + FID2).show();

        }

        return false;
    }

});

function ImgWH(i, MaxW, MaxH) {
    var o = new Image();
    o.src = i.src;
    var w = o.width;
    var h = o.height;
    var t;
    if (w > MaxW) {
        t = MaxW;
    }
    else {
        t = w;
    }

    if ((h * t / w) > MaxH) {
        i.height = MaxH;
        i.width = MaxH / h * w;
    }
    else {
        i.width = t;
        i.height = t / w * h;
    }
}


$(function () {
    $("input#sumbsou").click(function () {
        var str = $("#seatxt").val();
        if (str.length > 0 && str != "输入回车搜索") {
            window.location.href = "/Pro.aspx?keyword=" +
                encodeURI($("#seatxt").val());
        }
    });
});